package com.lagou.util;

/**
 * @Author: lishuangqiang
 * @Date: 2019/4/17
 * @Description:   日志工具类
 */

public enum LogLevel {

    ALL("[]", 0), INFO("[INFO]", 1), WARN("[WARN]", 2), ERROR("[ERROR]", 3);

    private String name;
    private int level;

    LogLevel(String name, int level) {
        this.name = name;
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public int getLevel() {
        return level;
    }
    public boolean isAllow(LogLevel minLevel){
        if(level >= minLevel.getLevel()){
            return true;
        }

        return false;
    }
}
